<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue组件10</title>
    <script src="../../js/vue3.js"></script>
    <style>
        #app {
            margin: 2rem auto;
            width: 50%;
        }
        
        p {
            font-size: 1.5rem;
            font-weight: bold;
        }
        
        img {
            width: 100%;
            height: 100%;
        }
        
        .head {
            display: flex;
            justify-content: space-around;
            height: 3rem;
            background-color: antiquewhite;
            padding: 0.5rem;
        }
    </style>
</head>

<body>
    <!-- 运行 -->
    <div id="app">
        <fa></fa>
    </div>
    <!-- 模版 -->
    <template id="fas">
        <son>
            <template v-slot:left>
                <img src="../../img/img_0.png">
            </template>
    <template v-slot:middle>
                <input type="text">
            </template>
    <template v-slot:right>
                登录
            </template>
    </son>

    </template>
    <template id="sons">
        <div class="head">
            <div>
                <slot name="left"></slot>
            </div>
            <div>
                <slot name="middle"></slot>
            </div>
            <div>
                <slot name="right"></slot>
            </div>
        </div>
    </template>
    <script>
        const v_app = Vue.createApp({
            data() {
                return {}
            },
            components: {
                fa: {
                    template: "#fas",
                    data() {
                        return {

                        }

                    },
                    components: {
                        son: {
                            template: "#sons",
                            data() {
                                return {

                                }

                            },
                        }
                    }
                }
            }
        });

        v_app.mount("#app");
    </script>
</body>

</html>